<template>
	<cl-crud ref="crud" @load="onLoad">
		<cl-pagefull>
			<template #head>
				<el-row type="flex">
					<!-- 刷新按钮 -->
					<cl-refresh-btn />
					<!-- 新增按钮 -->
					<cl-add-btn />
					<!-- 删除按钮 -->
					<cl-multi-delete-btn />
					<cl-flex1 />
					<!-- 关键字搜索 -->
					<cl-search-key />
				</el-row>
			</template>

			<!-- 数据表格 -->
			<cl-table v-bind="table"></cl-table>

			<template #foot>
				<el-row type="flex">
					<cl-flex1 />
					<!-- 分页控件 -->
					<zm-pagination />
				</el-row>
			</template>
		</cl-pagefull>
	</cl-crud>
</template>

<script>
export default {
	name: "WideVisitReport",
	data() {
		return {
			// 表格配置
			table: {
				"context-menu": ["refresh"],
				columns: [
					{
						type: "index",
						label: "#",
						align: "center",
						width: 50,
						fixed: true
					}
				]
			}
		};
	},
	created() {},
	mounted() {},
	methods: {
		onLoad({ ctx, app }) {
			ctx.service(this.$service.demo).done();
			app.refresh();
		},
		// crud刷新
		refresh() {
			this.$refs.crud.refresh({ page: 1 });
		}
	}
};
</script>

<style lang="scss" scoped></style>
